package com.fulu.game.bi.mysql.bi.channel;

import com.fulu.game.bi.entity.po.channel.GroupRel;
import com.fulu.game.bi.mysql.bi.ICommonDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GroupRelDao extends ICommonDao<GroupRel, Integer> {

    /**
     * 新增 分组关联
     */
    int insert(@Param("param") List<GroupRel> rel, @Param("tableName")String tableName);

    /**
     * 删除 分组关联
     */
    int delete(@Param("param") GroupRel rel, @Param("tableName")String tableName);

    /**
     * 通过groupId删除
     */
    int deleteByGroupId(@Param("groupId") Integer groupId, @Param("tableName")String tableName);

    /**
     * 通过relId删除
     */
    int deleteByRelId(@Param("relId") Integer relId, @Param("tableName")String tableName);
    /**
     * 通过groupId查询
     */
    List<GroupRel> findByGroupId(@Param("groupId") Integer groupId, @Param("tableName")String tableName);

    /**
     * 通过relId查询
     */
    List<GroupRel> findByRelId(@Param("relId") Integer relId, @Param("tableName")String tableName);
}
